<template>
	<view class="member-item">
		<view class="title-box">
			<view class="user-icon">
					<image class="icon" src="/static/image/user.png" mode="aspectFit"></image>
			</view>
			<view class="username">
				{{info.leaderName}}
			</view>
			<view class="identity" v-if="info.isProjectLeader == 1">
				项目负责人
			</view>
			<image class="shrink-icon" :class="{'up':shrinkType == true}" src="/static/image/push_icon.png" mode="aspectFit"  @click="shrinkTypeChange"></image>
		</view>
		<view class="count-box" v-if="shrinkType == true" >
			<view class="count-item" @click="goDetail(3)">
				<view class="num">
					{{info.count3}}
				</view>
				<view class="desc">
					完成提报
				</view>
			</view>
			<view class="count-item" @click="goDetail(4)">
				<view class="num">
					{{info.count4}}
				</view>
				<view class="desc">
					异常提报
				</view>
			</view>
			<view class="count-item" @click="goDetail(5)">
				<view class="num">
					{{info.count5}}
				</view>
				<view class="desc">
					正常完成
				</view>
			</view>
			<view class="count-item" @click="goDetail(6)">
				<view class="num">
					{{info.count6}}
				</view>
				<view class="desc">
					异常完成
				</view>
			</view>
			<view class="count-item" @click="goDetail(1)">
				<view class="num">
					{{info.count1}}
				</view>
				<view class="desc">
					进行中
				</view>
			</view>
			<view class="count-item" @click="goDetail(0)">
				<view class="num">
					{{info.count0}}
				</view>
				<view class="desc">
					未开始
				</view>
			</view>
			<view class="count-item" @click="goDetail(2)">
				<view class="num">
					{{info.count2}}
				</view>
				<view class="desc">
					已暂停
				</view>
			</view>
			<view class="count-item" @click="goDetail(7)">
				<view class="num">
					{{info.count7}}
				</view>
				<view class="desc">
					逾期
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			info:{
				type:Object,
				default:{}
			},
			borderBottom:{
				type:Boolean,
				default:false,
			},
			shrinkType:{
				type:Boolean,
				default:false,
			},
			index:{
				type:String || Number,
				default:0
			},
		},
		data() {
			return {
				
			}
		},
		mounted(){
			console.log('member',this.info);
		},
		methods: {
			shrinkTypeChange:function(){
				this.$emit('shrinkTypeChange',this.index);
			},
			/**
			 * 前往任务详情
			 */
			goDetail:function(status){
				let info = this.info;
				uni.navigateTo({
					url: '/subcontractList/project/task/task?leaderid='+ info.leaderId + '&projectid=' + info.projectId + '&status=' + status
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.member-item{
		background-color: white;
		padding: 20rpx;
		.title-box{
			display: flex;
			position: relative;
		.user-icon{
			width: 50rpx;
			height: 50rpx;
			border-radius: 100%;
			background-color: #78aff0;
			.icon{
				width: 100%;
				height: 100%;
			}
		}
			.username{
				font-size: 32rpx;
				font-weight: bold;
				margin-left: 20rpx;
				line-height: 50rpx;
			}
			.identity{
				background-color: #f9f2e9;
				color:#ef8525;
				margin-top:6rpx;
				margin-left: 10rpx;
				border:1px solid #ef8525;
				font-size: 24rpx;
				line-height: 30rpx;
				height: 30rpx;
				text-align: center;
				padding: 0 10rpx;
				border-radius: 20rpx 20rpx 20rpx 0rpx;
			}
			.shrink-icon{
				width: 50rpx;
				height: 50rpx;
				position: absolute;
				right: 0;
				top:0;
			}
			.up{
				transform:rotate(180deg);
			}
		}
		.count-box{
			display: flex;
			margin-top: 40rpx;
			flex-wrap: wrap;
			.count-item{
				width: 25%;
				text-align: center;
				margin:20rpx 0;
				.num{
					font-size: 40rpx;
				}
				.desc{
					font-size: 24rpx;
					color: #666666;
					margin-top:10rpx;
				}
			}
		}
	}
</style>
